package facade;

import java.util.Vector;

public class SQLSencillo {
	
	public String generar(Vector<String> campos, Vector valores,String tabla){
		String tira= "INSERT INTO "+tabla+" (";
		String ultimoC = campos.lastElement();
		for(String field: campos)
			if(field.equals(ultimoC))
				tira+=field+") VALUES (";
			else
				tira+=field+",";
		Object ultimoV = valores.lastElement();
		for(Object value: campos)
			if(value.equals(ultimoV))
				if(!(value instanceof String))
					tira+=""+value+",";
				else
					tira+="'"+value+"',";
			else
				if(!(value instanceof String))
					tira+=""+value+")";
				else
					tira+="'"+value+"')";
		return tira;
	}

}
